package com.xu.GOF23.bridge;

//抽象的电脑类  --下面有不同的类型
public abstract class Computer {
    //电脑自带品牌，组合 ~ 桥
    protected Brand brand;

    public Computer(Brand b) {
        this.brand = b;
    }

    public void info() {
        brand.info();//自带品牌
    }
}

//台式电脑
class Desktop extends Computer {
    public Desktop(Brand b) {
        super(b);
    }

    @Override
    public void info() {
        super.info();
        System.out.println("这是台式机");
    }
}

//笔记本电脑
class LapTop extends Computer {
    public LapTop(Brand b) {
        super(b);
    }

    @Override
    public void info() {
        super.info();
        System.out.println("这是台式机");
    }
}